package com.fastjrun.db2doc;

import cn.smallbun.screw.core.process.ProcessConfig;
import com.fastjrun.db2doc.service.Db2DocService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import javax.sql.DataSource;

@SpringBootApplication
public class Db2DocApplication {

  public static void main(String[] args) {
    ConfigurableApplicationContext ac = SpringApplication.run(Db2DocApplication.class, args);
    DataSource dataSource = ac.getBean(DataSource.class);
    Db2DocConfig db2DocConfig = ac.getBean(Db2DocConfig.class);
    ProcessConfig processConfig = ac.getBean(ProcessConfig.class);
    Db2DocService db2DocService = ac.getBean(Db2DocService.class);

    db2DocService.generatorDoc(dataSource, db2DocConfig, processConfig);
  }
}
